<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Thongke extends MY_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -  
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in 
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 Thu
	 */
	function __construct()
    {
        parent::__construct();	
		$this->data['tieude']="Thống kê";
		$this->loadadmin();
	}
	public function index()
	{	
		$this->load->model('Dondathang_model');	
		$this->data=$this->input->get();
		if(empty($this->data['thang']))
		{
			$now=getdate();
			$this->data['thang']=$now['mon'];
			}
		if(empty($this->data['nam']))
		{
			$now=getdate();
			$this->data['nam']=$now['year'];	
			}
		$this->data['datas']=$this->Dondathang_model->sanphambannhieu($this->data['thang'],$this->data['nam']);
		$this->load->view('thongke/banchay',$this->data);
		$this->load->view('layout/footer');
	}
	public function doanhthu()
	{
		$this->load->model('Dondathang_model');	
		$this->data=$this->input->get();
		if(empty($this->data['thang']))
		{
			$now=getdate();
			$this->data['thang']=$now['mon'];
			}
		if(empty($this->data['nam']))
		{
			$now=getdate();
			$this->data['nam']=$now['year'];	
			}
		$this->data['datas']=$this->Dondathang_model->doanhthu($this->data['thang'],$this->data['nam']);
		$this->load->view('thongke/doanhthu',$this->data);
		$this->load->view('layout/footer');
	}

	
}
/* Location: ./application/controllers/welcome.php */